package com.patternsbox;

import com.patternsbox.behavioral.chainofresponsibility.ChainOfResponsibilityAction;
import com.patternsbox.behavioral.command.CommandAction;
import com.patternsbox.behavioral.interpreter.InterpreterAction;
import com.patternsbox.behavioral.iterator.IteratorAction;
import com.patternsbox.behavioral.mediator.MediatorAction;
import com.patternsbox.behavioral.memento.MementoAction;
import com.patternsbox.behavioral.observer.ObserverAction;
import com.patternsbox.behavioral.state.StateAction;
import com.patternsbox.behavioral.strategy.StrategyAction;
import com.patternsbox.behavioral.templatemethod.TemplateMethodAction;
import com.patternsbox.behavioral.visitor.VisitorAction;
import com.patternsbox.creational.abstractfactory.AbstractFactoryAction;
import com.patternsbox.creational.builder.BuilderAction;
import com.patternsbox.creational.factorymethod.FactoryMethodAction;
import com.patternsbox.creational.prototype.PrototypeAction;
import com.patternsbox.creational.singleton.SingletonAction;
import com.patternsbox.structural.adapter.AdapterAction;
import com.patternsbox.structural.bridge.BridgeAction;
import com.patternsbox.structural.composite.CompositeAction;
import com.patternsbox.structural.decorator.DecoratorAction;
import com.patternsbox.structural.facade.FacadeAction;
import com.patternsbox.structural.flyweight.FlyweightAction;
import com.patternsbox.structural.proxy.ProxyAction;

class MainClass {

	public static void main(String[] args) {
		ActionTemplate [] creational = {
				new AbstractFactoryAction(),
				new BuilderAction(),
				new FactoryMethodAction(),
				new PrototypeAction(),
				new SingletonAction()
		};
		
		ActionTemplate [] structural = {
				new AdapterAction(),
				new BridgeAction(),
				new CompositeAction(),
				new DecoratorAction(),
				new FacadeAction(),
				new FlyweightAction(),
				new ProxyAction()
		};

		ActionTemplate [] behavioral = {
				new ChainOfResponsibilityAction(),
				new CommandAction(),
				new InterpreterAction(),
				new IteratorAction(),
				new MediatorAction(),
				new MementoAction(),
				new ObserverAction(),
				new StateAction(),
				new StrategyAction(),
				new TemplateMethodAction(),
				new VisitorAction()
		};

		runActions(creational);		
		runActions(structural);
		runActions(behavioral);
	}
	
	private static void runActions(ActionTemplate [] actions){
		for (ActionTemplate applicationAction : actions) {
			applicationAction.execute();
		}
	}
}
